<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
	<meta name="author" content="">
	<title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
	<% include("../inc/list_css.html"){}%>
	<style>
		.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
			position: relative;
			line-height: 34px;
			margin-top: 10px!important;
			margin-bottom: 10px!important;
		}

	</style>
</head>
<body>
<div class="ibox ">
	<div class="ibox-title">
		<div class="pull-left mbx navbar_title">
			<span>访问量统计 </span>
			<span class="line">/</span>
			pv,uv统计
		</div>
	</div>

	<div class="ibox-content">
		<div class="wrapper wrapper-content">
			<div class="row">
				<div class="col-md-12">

					<div class="alert alert-warning alert-dismissable">
						<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
						可以查看pv,uv的统计及转换率
					</div>

					<div id="eventsToolbar" class="form-inline hive_input">
						&nbsp;&nbsp;&nbsp;<label style="color:#5b5d61;font-weight: 400">浏览量(PV):</label><label style="font-weight: bolder;line-height: 1;background-color:#DCEBFE;;">${pv!}</label>
						<!--<input  id="name" style="width:200px;" class="btn btn-outline"/>-->
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label style="color:#5b5d61;font-weight: 400">访客数(UV):</label><label style="font-weight: bolder;line-height: 1;background-color: #DCEBFE;;">${uv!}</label>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label style="color:#5b5d61;font-weight: 400">转换率:</label><label style="font-weight: bolder;line-height: 1;background-color:#DCEBFE;;">${percent!}</label>
					</div>
					<table data-toggle="table " id="table" data-show-export="true" class=" table-striped table-no-bordered fixed-table-container table-row-border-color table-hovered table-hover">
						<thead class="table-header">
						<tr>
							<th data-field="ip">IP</th>
							<th data-field="wapOrPc" data-formatter="wapOrPcFormatter">设备类型</th>
							<th data-field="browserType" data-formatter="browserTypeFormatter">浏览器类型</th>
							<th data-field="createDate">创建时间</th>
						</tr>
						</thead>
					</table>

				</div>
			</div>
		</div>
	</div>
</div>


<% include("../inc/list_js.html"){}%>
<script>

    function wapOrPcFormatter(v) {
        if(v==0){
            return 'wap';
        }else if(v==1){
            return 'pc';
        }
    }
    function browserTypeFormatter(v) {
        if(v==0){
            return '其他';
        }else if(v==1){
            return 'IE浏览器';
        }else if(v==2){
            return '火狐浏览器';
        }else if(v==3){
            return 'UC浏览器';
        }else if(v==4){
            return 'QQ浏览器';
        }else if(v==5){
            return '世界之窗浏览器';
        }else if(v==6){
            return '谷歌浏览器';
        }
    }

	/*function opFormatter(value, row, index){
	 var html='';
	 html = '<a href="javascript:void(0)" onclick="edit(\''+row.id+'\');" class="fa fa-pencil" data-toggle="tooltip" title="编辑" style="font-size: 15px"></a>';

	 html += '<a href="javascript:void(0)" onclick="del(\''+row.id+'\');"><span style="margin-left:10px;font-size: 15px" class="fa fa-trash-o" data-toggle="tooltip" title="删除"></span></a>';
	 return html;
	 }*/

    function refresh_table() {
        $('#cpTableEvents').bootstrapTable('refresh');
    }

	/*function del(v) {
	 G.ui.tips.confirm_back('确定要删除吗？', 'delete',{"ids":v},refresh_table);
	 }*/
    function edit(v) {
        location.href = "edit?id="+v+"&type=1";
    }
    /**
     * 加载页面数据
     * */
    (function () {

        $('#table').bootstrapTable({
            url: "ajaxlist?type=1",
            dataType: 'json',
            contentType: 'application/json',
            search: true,
            searchAlign: 'right',
            pagination: true,
            showRefresh: true,
            pageSize: 20,
            showToggle: false,//是否显示card/table切换按钮
            showColumns: true,//是否显示内容列下拉框
            pageList: [20, 50, 100],
            iconSize: 'outline',
            toolbar: '#eventsToolbar',
            paginationHAlign: 'right', //right, left
            paginationVAlign: 'bottom',
            icons: {
                refresh: 'icon-refresh',
                toggle: 'glyphicon-list-alt',
                columns: 'icon-select',
                export: 'icon-export'
            },
            responseHandler: function (res) {
                $("#dsh").html(res.length);
                return res;
            },
            formatNoMatches: function () { //判断有无数据
                var imghtml = '<div class="flexed_column content_center content_alignCenter padding-20"><img src="https://static.9hive.cn/global/img/nodata.png" class="no_data"/><span class="font-size-16">暂无数据</span></div>';
                return imghtml;
            },
            formatLoadingMessage: function () {  //数据加载中样式
                return ' <div id="loading"><div id="loading-center">' +
                    '<div id="loading-center-absolute"><div class="object" id="object_one">' +
                    '</div><div class="object" id="object_two"></div><div class="object" id="object_three">' +
                    '</div><div class="object" id="object_four"></div></div></div>努力加载中...</div>'
            },
        });

        $('#add').on('click', function (e) {
            location.href = 'add';
        });

        $(".wrapper").tooltip({selector: "[data-toggle=tooltip]", container: "body"});

    })();
</script>
</body>
</html>